home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
perl
/
prlbkxmp.lha
/
ch5
/
forkdaemon.eg
< prev
next >
Wrap
Text File
|
1991-01-08
|
257b
|
13 lines
unless (fork) { # this is the child
unless (fork) { # this is the child's child
sleep 1 until getppid == 1;
for (1..1000) {
system "foo $_";
}
exit 0;
}
# first child exits quickly
exit 0;
}
wait; # parent reaps first child quickly